<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>This</title>
</head>
<body>
    <script>
        // let fn1=()=>{
        //     console.log(`hello${this.name}`);
        // }
        //es6写法不能指定this

        function fn1(name1,name2){
            console.log(`hello,${name1},${name2},我是${this.name}`);
        }
        
        let obj1={
            name:'whh'
        }
        fn1.call(obj1,'zks','lbb');//hello,zks,lbb,我是whh
        fn1.apply(obj1,['zks','lbb']);//hello,zks,lbb,我是whh

        fn2=fn1.bind(obj1);
        fn2('zks','wbb');//hello,zks,lbb,我是whh

        ;(function(){let a=console.log(this);return a;}.call(this));
        
    </script>
</body>
</html>